class String
	def no_html
		str = self.dup
		str.gsub!(/<\/?[^>]*>/, '')
		str.strip!
		str.gsub!('&nbsp;', '')
		str
	end
end

ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
 %(<span style="font-size:12px;color:red;">#{instance.error_message.kind_of?(Array) ? instance.error_message.first : instance.error_message}</span><br>) + html_tag
end

module SymbolExtension # :nodoc:
  # Localizes the symbol into the current locale. 
  # If there is no translation available, the replacement string will be returned
  def localize(args={})
    I18n.translate(:"txt.#{self.to_s}") 
  end
  alias :l :localize
  
  def l_in(locale, args={})
    #Globalite.localize(self, '_localization_missing_', args, locale) unless locale.nil?
  end
  
  # Note that this method takes the replacement string after the args hash unlike other Globalite methods
  def localize_with_args(args={}, replacement_string = '__localization_missing__')
    #Globalite.localize(self, replacement_string, args)
  end
  alias :l_with_args :localize_with_args
end

Symbol.send :include, SymbolExtension
